package com.sdx.console.content.entity;

import java.util.Date;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

import com.fasterxml.jackson.annotation.JsonIgnore;
import org.beetl.sql.core.annotatoin.ColumnIgnore;
import org.beetl.sql.core.annotatoin.AutoID;
import org.beetl.sql.core.annotatoin.SeqID;
import org.apache.commons.lang3.StringUtils;
import com.ibeetl.admin.core.util.ValidateConfig;
import com.sdx.service.ConfigService;

import org.beetl.sql.core.TailBean;
import java.math.*;

import com.ibeetl.admin.core.annotation.Dict;
import com.ibeetl.admin.core.entity.BaseEntity;

import org.beetl.sql.core.annotatoin.InsertIgnore;
import org.beetl.sql.core.annotatoin.Version;
import org.beetl.sql.core.annotatoin.LogicDelete;
import com.sdx.common.utils.Utils;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;

/* 
* 
* gen by Spring Boot2 Admin 2019-04-04
*/
@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
@Data
public class EbookChapter extends BaseEntity{

    //章节id
    @NotNull(message = "ID不能为空", groups =ValidateConfig.UPDATE.class)
    @AutoID	
    private Integer chapterId ;
	
    //所属电子书
    private Integer bookId ;
	
    //章节序号
    private Integer chapterNo ;
	
    //章节页码
    private Integer pageNo ;

    //下载地址
    private String url;
	
    //章节标题
    private String chapterTitle ;
	
    //章节类型 1、普通章节，2、大章节，3、无内容章节
    private Integer chapterType ;
	
    //上级章节
    private Integer pChapterId ;
	
    //章节内容
    private String chapterContent ;
	
    //是否免费 1、免费，0、不免费
    private String isFree ;
	
    //章节价格，单位分
    private Integer chapterPrice ;
	
    //可用标记 1、可用，0、不可用
    private Integer chapterStatus ;
	
    //创建人
    private Integer createdBy ;
	
    //创建人名称
    private String createdName ;
	
    //创建时间
    private Date createdTime ;
	
    //更新人
    private Integer updatedBy ;
	
    //更新人名称
    private String updatedName ;
	
    //更新时间
    private Date updatedTime ;

    public String getUrlLink(){
        return Utils.imageUrl(url);
    }

}
